package com.chris.vue.controller;

import com.chris.vue.models.items.GoodsInfoItem;
import com.chris.vue.models.net.NetResult;
import com.chris.vue.service.GoodsService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Chris Chan
 * 2020/8/18 5:37
 * Use for:
 * Explain:
 */
@Log4j2
@RestController
@RequestMapping("api/goods")
public class GoodsController {
    @Autowired
    GoodsService goodsService;

    @GetMapping("getGoodsList")
    public NetResult<List<GoodsInfoItem>> getGoodsList() {
        return NetResult.ok(goodsService.getGoodsList());
    }
}
